package com.voda.entity;

import static javax.persistence.GenerationType.IDENTITY;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import com.voda.entity.api.AbstractBaseEntity;

/**
 * The Class User.
 */
@Entity
@Table(name = "user")
public class User extends AbstractBaseEntity implements java.io.Serializable {

	/** The Constant serialVersionUID. */
	private static final long serialVersionUID = -208081089260075266L;
	
	/** The user id. */
	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "user_id", unique = true, nullable = false)
	private Long id;
	
	/** The role. */
	@ManyToOne(fetch = FetchType.LAZY, targetEntity=Role.class)
	@JoinColumn(name = "usr_role_fk", nullable = false)
	private Role role;
	
	/** The email. */
	@Column(name = "usr_email", length = 45)
	private String email;
	
	/** The password. */
	@Column(name = "usr_password", length = 45)
	private String password;
	
	/** The is blocked. */
	@Column(name = "usr_is_blocked")
	private Boolean isBlocked;
	
	/**
	 * Instantiates a new user.
	 */
	public User() {
	}

	/* (non-Javadoc)
	 * @see com.voda.entity.api.IBaseEntity#getId()
	 */
	public Long getId() {
		return this.id;
	}

	/* (non-Javadoc)
	 * @see com.voda.entity.api.IBaseEntity#setId(java.lang.Long)
	 */
	public void setId(Long id) {
		this.id = id;
	}

	/**
	 * Gets the role.
	 *
	 * @return the role
	 */
	public Role getRole() {
		return this.role;
	}

	/**
	 * Sets the role.
	 *
	 * @param role the new role
	 */
	public void setRole(Role role) {
		this.role = role;
	}

	/**
	 * Gets the email.
	 *
	 * @return the email
	 */
	public String getEmail() {
		return this.email;
	}

	/**
	 * Sets the email.
	 *
	 * @param email the new email
	 */
	public void setEmail(String email) {
		this.email = email;
	}
	
	/**
	 * Gets the password.
	 *
	 * @return the password
	 */
	public String getPassword() {
		return this.password;
	}

	/**
	 * Sets the password.
	 *
	 * @param password the new password
	 */
	public void setPassword(String password) {
		this.password = password;
	}

	/**
	 * Checks if is blocked.
	 *
	 * @return the boolean
	 */
	public Boolean isBlocked() {
		return this.isBlocked;
	}

	/**
	 * Sets the blocked.
	 *
	 * @param isBlocked the new blocked
	 */
	public void setBlocked(Boolean isBlocked) {
		this.isBlocked = isBlocked;
	}

	/**
	 * Gets the checks if is blocked.
	 *
	 * @return the checks if is blocked
	 */
	public Boolean getIsBlocked() {
		return isBlocked;
	}

	/**
	 * Sets the checks if is blocked.
	 *
	 * @param isBlocked the new checks if is blocked
	 */
	public void setIsBlocked(Boolean isBlocked) {
		this.isBlocked = isBlocked;
	}
	
}
